package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商品规格关系表
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-23
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_shop_product_spec")
@ApiModel(value = "ShopProductSpec", description = "商品规格关系表")
@AllArgsConstructor
public class ShopProductSpec extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 所属商品id
     */
    @ApiModelProperty(value = "所属商品id")
    @NotNull(message = "所属商品id不能为空")
    @TableField("product_id")
    @Excel(name = "所属商品id")
    private Long productId;

    /**
     * 规格类型id
     */
    @ApiModelProperty(value = "规格类型id")
    @NotNull(message = "规格类型id不能为空")
    @TableField("spec_id")
    @Excel(name = "规格类型id")
    private Long specId;

    /**
     * 规格类型值id
     */
    @ApiModelProperty(value = "规格类型值id")
    @NotNull(message = "规格类型值id不能为空")
    @TableField("spec_value_id")
    @Excel(name = "规格类型值id")
    private Long specValueId;

    /**
     * 是否有图 0-否 1-是
     */
    @ApiModelProperty(value = "是否有图 0-否 1-是")
    @TableField("has_img")
    @Excel(name = "是否有图 0-否 1-是")
    private Integer hasImg;

    /**
     * 排序值
     */
    @ApiModelProperty(value = "排序值")
    @TableField("order_sort")
    @Excel(name = "排序值")
    private Integer orderSort;


    @Builder
    public ShopProductSpec(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long productId, Long specId, Long specValueId, Integer hasImg, Integer orderSort) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.productId = productId;
        this.specId = specId;
        this.specValueId = specValueId;
        this.hasImg = hasImg;
        this.orderSort = orderSort;
    }

}
